import request from "@/api/index"

export default {
  /**
   * @description: 添加员工 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  add (params) {
    const url = "base/staff/add"
    return request.post(url, {
      homeBaseId: sessionStorage.getItem("homeBaseId"),
      homeBaseType: sessionStorage.getItem("homeBaseType"),
      ...params
    })
  },
  /**
   * @description: 编辑员工 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  edit (params) {
    const url = "base/staff/edit"
    return request.post(url, {
      homeBaseId: sessionStorage.getItem("homeBaseId"),
      homeBaseType: sessionStorage.getItem("homeBaseType"),
      ...params
    })
  },
  /**
   * @description: 删除员工 *代表必填
   * @param {String/Number} staffId *
   * @return {Object}
   */
  delById (params) {
    const url = "base/staff/delById"
    return request.get(url, params)
  },
  /**
   * @description: 批量删除员工 *代表必填
   * @param {String/Number} staffId *
   * @return {Object}
   */
  delListById (params) {
    const url = "base/staff/delListById"
    return request.get(url, params)
  },
  /**
   * @description: 获取员工详细信息 *代表必填
   * @param {String/Number} staffId *
   * @return {Object}
   */
  getStaffDetailById (params) {
    const url = "/base/staff/getStaffDetailById"
    return request.get(url, { ...params })
  },
  /**
   * @description: 获取员工名字 *代表必填
   * @param {String/Number} staffId *
   * @return {Object}
   */
  getStaffNameById (params) {
    const url = "/base/staff/getStaffNameById"
    return request.get(url, { ...params })
  },
  /**
   * @description: 条件查询 *代表必填
   * @param {String/Number} staffId *
   * @return {Object}
   */
  queryByCondition (params) {
    const url = "base/staff/queryByCondition"
    return request.post(url, {
      homeBaseId: sessionStorage.getItem("homeBaseId"),
      homeBaseType: sessionStorage.getItem("homeBaseType"),
      ...params
    })
  },
  /**
   * @description: 分页查询员工 *代表必填
   * @param {Object} params *
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @return {Object}
   */
  queryPageByCondition (params) {
    const url = "base/staff/queryPageByCondition"
    return request.post(url, {
      homeBaseId: sessionStorage.getItem("homeBaseId"),
      homeBaseType: sessionStorage.getItem("homeBaseType"),
      ...params
    })
  },
}
